<template>
  <div class="wrap">
      <p class="title">我的账单</p>
    <van-cell-group v-for="(item,index) in accountList" :key="index" >
      <van-cell title="收入" :value="item.totalAmount" />
      <van-cell title="类型" value="运费款"  />
      <van-cell title="时间" :value="item.requestTime|moment"  />
    </van-cell-group>
    <p v-if="(this.accountList.length==0)" style="text-align:center;color:#666666">暂无账单信息</p>
  </div>
</template>
<script>
import { Panel,Cell, CellGroup} from "vant";
import {getData} from '../utils/api';
export default {
  name: "myBill",
  data(){
    return {
      accountList:[],
      code:""
    }
  },  
  mounted(){
    getData({
      method:"getPaymentBillList",
      dataBody:{
        receiverIdentityNo:sessionStorage.getItem("idCard"),
        bankNo:sessionStorage.getItem("bankNo")
      }
    }).then((res)=>{
       if (res.data.result.code == 0) {
        this.accountList=res.data.result.data
      } else {
        if (res.data.result.msg == "请求数据丢失，请重新登陆") {
            alert(res.data.result.msg)
            this.$router.push({ path: "/" });
      
        } else {
         alert(res.data.result.msg);
        }
      }
      
    })
  }
};
</script>
<style scoped>
.wrap {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  overflow-y: auto;
  background-color: rgb(248, 248, 248);
}
.title {
  padding: 10px 16px;
  color: #323233;
  font-size: 14px;
  margin: 0;
  color: rgba(69, 90, 100, 0.6);
}
.van-cell-group{
  margin-bottom: 10px
}
</style>